<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Listar Alunos</title>
        <script type="text/javascript">
            function show_confirm(act,gotoid){
                if(act=="edit")
                    var r=confirm("Do you really want to edit?");
                else
                    var r=confirm("Do you really want to delete?");
                if (r==true) {
                    window.location="<?php echo base_url();?>index.php/users/"+act+"/"+gotoid;
                }
            }
        </script>
    </head>
    <body>
        <table width="600" border="1" cellpadding="5">
            <tr>
                <th scope="col">ID</th>
                <th scope="col">Nome</th>
                <th scope="col">Data de Nascimento</th>
                <th scope="col">Nome da Mãe</th>
                <th scope="col">Telefone da Mãe</th>
                <th scope="col">Celular da Mãe</th>
                <th scope="col">Nome do Pai</th>
                <th scope="col">Telefone do Pai</th>
                <th scope="col">Celular do Pai</th>
                <th scope="col">Nome do Responsável</th>
                <th scope="col">Telefone do Responsável</th>
                <th scope="col">Profissão do Responsável</th>
                <th scope="col">Endereço</th>
                <th scope="col">Telefone</th>
                <th scope="col">Com Quem Mora</th>
                <th scope="col">Com Quantas Pessoas Mora</th>
                <th scope="col">Renda Mensal</th>
                <th scope="col">Nome da Escola</th>
                <th scope="col">Série</th>
                <th scope="col">Turno</th>
            </tr>
            
                <?php foreach ($user_list as $u_key){ ?>
            
            <tr>
                <td><?php echo $u_key->usuario_id; ?></td>
                <td><?php echo $u_key->nome; ?></td>
                <td><?php echo $u_key->mae_nome; ?></td>
                <td><?php echo $u_key->mae_telefone; ?></td>
                <td><?php echo $u_key->mae_celular; ?></td>
                <td><?php echo $u_key->pai_nome; ?></td>
                <td><?php echo $u_key->pai_telefone; ?></td>
                <td><?php echo $u_key->pai_celular; ?></td>
                <td><?php echo $u_key->responsavel_nome; ?></td>
                <td><?php echo $u_key->responsavel_telefone; ?></td>
                <td><?php echo $u_key->profissao_resp; ?></td>
                <td><?php echo $u_key->endereco; ?></td>
                <td><?php echo $u_key->telefone; ?></td>
                <td><?php echo $u_key->com_quem_mora; ?></td>
                <td><?php echo $u_key->quantas_pessoas_mora; ?></td>
                <td><?php echo $u_key->renda_mensal; ?></td>
                <td><?php echo $u_key->escola; ?></td>
                <td><?php echo $u_key->serie; ?></td>
                <td><?php echo $u_key->turno; ?></td>
                <td width="40" align="left" ><a href="#" onClick="show_confirm('edit',<?php echo $u_key->id;?>)">Editar</a></td>
                <td width="40" align="left" ><a href="#" onClick="show_confirm('delete',<?php echo $u_key->id;?>)">Deletar </a></td>
            </tr>
                <?php }?>
            <tr>
                <td colspan="7" align="right"> <a href="<?php echo base_url();?>index.php/user/add_form">Inserir Novo</a></td>
            </tr>
        </table>
    </body>
</html>